package com.fjzx.frame.adapter;

import android.support.annotation.NonNull;
import android.support.v7.util.DiffUtil;
import android.text.TextUtils;
import android.widget.TextView;

import com.fjzx.androidframe.base.adapter.BasePagedRecyclerViewAdapter;
import com.fjzx.androidframe.base.annotation.ContentView;
import com.fjzx.androidframe.base.annotation.ItemView;
import com.fjzx.frame.R;
import com.fjzx.frame.entity.HomeEntity;

/**
 * @author xiongyongcong
 */
@ItemView(R.layout.item_home_artical)
public class HomeListAdapter extends BasePagedRecyclerViewAdapter<HomeEntity> {
    @Override
    protected void bindData(BasePagedViewHolder holder, int position, @NonNull HomeEntity data) {
        TextView tvAuthor = holder.getView(R.id.tv_author);
        TextView tvTitle = holder.getView(R.id.tv_title);
        TextView tvTime = holder.getView(R.id.tv_time);
        tvTitle.setText(data.getTitle());
        tvTime.setText(data.getNiceDate());
        tvAuthor.setText(data.getAuthor());
    }
}
